<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  
<%@page import="java.util.List"%>
<%@page import="gamble.qna.vo.BoardVO"%>
<%@page import="gamble.qna.vo.PageVO"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>QnA</title>
</head>
<body link="#FBF5EF" vlink="#FBF5EF" alink="#FBF5EF" bgcolor="#084B8A" >




 
 <table width="740" bgcolor="#084B8A" bordercolor="#FFFACD" style="border-collapse:collapse;" border="1">
   <tr>
     <th width="40" ><font color="#F6CECE" >번호</font></th>
     <th width="400"><font color="#F6CECE">제목</font></th>
     <th width="80"><font color="#F6CECE">글쓴이</font></th>
     <th width="165"><font color="#F6CECE">날짜</font></th>
     <th width="55"><font color="#F6CECE">조회수</font></th>
   </tr>
   

      <c:forEach var="list" items="${list}">
    	<tr>
    	 <td align="center" ><font color="#FAAC58"><c:out value="${list.num}"/></font></td>
    	  <td>
    	  <c:if test="${list.re_level>0}">
    	   <img src='images/qna/level.gif' width="${list.re_level*5}"/>	  
    	   <img src='images/qna/re_dot2.gif'/><font color="#9AFE2E">[답변]</font>
    	  </c:if>
    	     		  
    	 <font color="#FBF5EF"><a href="view.js?currentPage=${pv.currentPage}&num=${list.num}"
    	 							style="text-decoration:none;">
    	        ${list.subject}</a>
    	  
    	  <c:if test="${list.readcount>=5}">
    		 <img src='images/qna/hot.gif'/>
    		 </c:if>
    		 
    	  <%-- <c:if test="${fn.length(list.upload2)>= 7}"> --%>
    	 <c:if test="${list.upload2 != 'c:'}">
    	  	<img src="images/qna/img.gif"/>
    	  </c:if> 
    		 
    		 </font>
    
    	  </td>
    	  <td align="center""><font color="#FBF5EF">${list.writer}</font></td>
    	  <td align="center"><font color="#FBF5EF">${list.reg_date}</font></td>
    	  <td align="center"><font color="#FBF5EF">${list.readcount}</font></td>
    	  </tr>
     
      </c:forEach> 
 </table>
 


<table width="740">
	<form name="frm" action="search.js" method="post">
 <tr>
 
   <td align="center" valign="middle">
  
   
      <c:choose>   
    <c:when test="${pv.currentPage<=pv.blockPage}">
    	<c:out value="이전" />
    </c:when> 
    
    <c:otherwise>    	
    	<c:set var="currentPage" value="${pv.startPage-pv.blockPage}"/>    	
       <a href="list.js?currentPage=${currentPage}">이전</a>
    </c:otherwise>
     </c:choose> 
     
     <c:forEach var="i"  begin="${pv.startPage}" end="${pv.endPage}">
        	<a href="list.js?currentPage=${i}" >${i}</a>
   </c:forEach>
    
    <c:choose>
    <c:when test="${pv.endPage==pv.totalPage}">
    	<c:out value="다음"/>
    </c:when>    
    
    <c:otherwise>
    <c:set  var="currentPage" value="${pv.startPage+pv.blockPage}"/>  
    	
    	<a href="list.js?currentPage=${currentPage}">다음</a> 	
   </c:otherwise>

   </c:choose>
   </td>
   <td align="center" valign="bottom">
    
	<input type="text" name="search" size="40"/>
	<input class="submit" type="submit" value="검색"/>
	
	</td>
	<td align="center" valign="middle">
	<a href="write.js">글쓰기</a></td>
	
	<tr>
	</form>
	
	
	
   
   
   	


   </table>
 
</body>
</html>